<template>
  <div>
    <div>name:{{ name }}</div>
    <div>age:{{ age }}</div>
    <button @click="name = '胖鸡'">改变name</button>
  </div>
</template>

<script>
import { reactive,toRefs } from "vue";
export default {
  name: "APP",
  setup() {
    const state = reactive({
      name: "cp",
      age: 18,
    });
    return {
      ...toRefs(state)
    };
  },
};
</script>

<style>
</style>